<?php
include 'header.php';

@$pageNum = pageNum($pageNum);
$sql = 'select id,name from type order by id asc';
$pageSize = 10;
@$types = dbSelectPage($sql,$pageNum,$pageSize);
@$count = dbSelectAll($sql);
$num = ceil(count($count)/$pageSize);
?>
		<div class='container'>
   			<div class='row'>
   				<div class='col-xs-2'>
   					<a href='index.php' class='btn btn-default btn-block'>返回首页</a>
   					<a href='addGoodsType.php?addType=type' class='btn btn-default btn-block'>添加商品类型</a>
   					<a href='goodsList.php' class='btn btn-default btn-block'>商品列表</a>
   					<a href='addGoodsType.php?addType=goods' class='btn btn-default btn-block'>添加商品</a>
   				</div>
   				<div class='col-xs-6'>
   					<div class='panel panel-primary'>
   						<div class='panel-heading'>
   							<div class='panel-title'>所有商品价格列表</div>
   						</div>
   						<table class='typeTable table table-bordered'>
   							<tr>
   								<th>名称</th>
   								<th>编辑</th>
   							</tr>
   							<?php foreach($types as $type){?>
	   							<tr id='typeTr<?php echo $type['id'];?>'>
	   								<td><?php echo $type['name'];?></td>
	   								<td>
	   									<a href='updateGoodsType.php?typeId=<?php echo $type['id'];?>&&updateType=type'>编辑</a>
	   									<a href='#' id='deleteType<?php echo $type['id'];?>'>删除</a>
	   								</td>
	   							</tr>
	   						<?php }?>
   						</table>
   						<div class='panel-body'>
   							<?php include 'pageTemp.php';?>
   						</div>
   					</div>
   				</div>
   			</div>
   		</div>
   	</body>
</html>